import fr.storeme.android.tinywebdb.server.store.DataAIimport java.util.ArrayList
import com.google.gson.Gson
import java.net.URLEncoder
import java.net.URL
import groovyx.gaelyk.logging.GroovyLogger

response.setContentType("application/jsonrequest")

def tag = request.getParameter("tag")

log.info "tag :" +tag
String[] returnAR = new String[3];
Gson gson = new Gson();

returnAR[0] ="VALUE"
returnAR[1] =tag
returnAR[2] = process(tag)

log.info "value :" +returnAR[2]
log.info "gson.toJson(returnAR) :" +gson.toJson(returnAR)

println gson.toJson(returnAR)

private String process(String tag){	DataAI data= dao.ofy().get(DataAI.class, tag)	if (data!=null &&data.getValue() !=null)
		return data.getValue().getValue();	else		return ""
}